import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/Layout/indexLayout.vue'
import Home from '@/views/Home/indexHome.vue'
import Search from '@/views/Search/indexSearch.vue'
import Play from '@/views/Play/indexPlay.vue'
import component from '@/views/Comment/indexComment.vue'
import HotRank from '@/views/HotRank/indexHot.vue'
import Songsheet from '@/views/Songsheet/indexSongsheet.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/layout'
  },
  {
    path: '/layout',
    component: Layout,
    children: [
      {
        path: 'home',
        component: Home,
        meta: {
          title: '首页'
        }
      },
      {
        path: 'search',
        component: Search,
        meta: {
          title: '搜索'
        }
      },
      {
        path: 'hotrank',
        component: HotRank,
        meta: {
          title: '热门榜'
        }
      }
    ]
  }, {
    path: '/play',
    component: Play
  },
  {
    path: '/component',
    component: component
  },
  {
    path: '/songsheet',
    component: Songsheet
  }
]

const router = new VueRouter({
  routes
})

export default router
